component accessors="true"
{
	property name="metadata";
	property name="properties";
			
	public function init( metadata )
	{
		variables.metadata = arguments.metadata;
		properties = {};
	}
		
	public function containsProperty( name, caseSensitive )
	{
		if ( not structKeyExists( arguments, "caseSensitive" ) ) arguments.caseSensitive = false;
		
		if ( not caseSensitive )
		{
			return structKeyExists( properties, name );
		}
		else
		{
			var key = "";
			for ( key in properties )
			{
				//Compare() is such a fricking stupid function.
				if ( compare( key, name ) eq 0 )
				{
					return true;
				}
			}
			return false;
		}

	}
	
	public function getProperty( name )
	{
		if ( !containsProperty(name) )
		{
			throw (metadata.name + " doesn't contain a property named " + name );
		}
		
		return properties[ name ];
	}
	
	public function addProperty( property )
	{
		properties[ property.getName() ] = property;
	}
}